package com.syc.ssm.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.syc.ssm.domain.User;
import com.syc.ssm.service.IUserService;

/*
 * 三层架构的Web层---用户模块的控制器.
 */

@Controller
@RequestMapping("/user") // 用户模块
public class UserController {

	@Autowired
	@Qualifier("userService")
	private IUserService service;

	/*public void setService(IUserService service) {
		this.service = service;
	}*/

	// 注册功能
	@RequestMapping("/register")
	public String registerUser(Model model, User user) {

		service.userRegister(user);

		model.addAttribute("user", user);

		return "/WEB-INF/pages/success.jsp";
	}
}
